#ifndef COLORLEGEND_H
#define	COLORLEGEND_H

#include <rfftw.h>
#include <string>
#include "ColorLegend.h"
#include "ColorMap.h"

class ColorLegend
{    
    fftw_real d_width;
    fftw_real d_height;
    fftw_real d_xpos;
    fftw_real d_ypos;     
    
    int d_numColors;
    bool d_banded;
    
    ColorMap *d_map;
    
    double d_min;
    double d_max;   
    
    public:
        
        ColorLegend();
        ColorLegend(double width, double height, double x, double y, ColorMap *map);
        ColorLegend(double width, double height, double x, double y, int num_colors);
        
        void draw(fftw_real wn, fftw_real hn);
        

        
    private:
        
        void drawColorsCont(fftw_real wn, fftw_real hn);
        void drawColorsDisc(fftw_real wn, fftw_real hn);
        void drawBorders(fftw_real wn, fftw_real hn);
        void drawBackground(fftw_real wn, fftw_real hn);
};



void drawBitmapText(std::string const &str, double x, double y);

#endif	/* COLORLEGEND_H */

